vcComponentCreator

vcComponentCreator uses a component as a template for creating other components.

See in: Overview

Module: vcBehaviors

Parent: vcContainer

Children -

Referenced by: -

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
BlockingOptimizationBooleanRWGets or sets value for the optimization of creator when making new components, thereby improving simulation performance.
See more
If True, the creator will not check for capacity rather listen for event. The creator is informed, for example by component or capacity controller, when there is capacity to make a new component.
IntervalRealRWGets or sets the interval (in seconds) for creating components.
LimitIntegerRWGets or sets the maximum number of components that can be created by creator during a simulation.
PartStringRWGets or sets the URI or VCID of template component.
TemplateComponentvcComponentRWGets or sets the template used by creator to create new components during a simulation.
Either this property or Part can be used to define the template component of creator.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
createvcComponentOptional Keyword[wait = Boolean]Creates a new component from template.
See more
An optional wait argument can be given to use BlockingOptimization.

If creation fails, returns None. Generally, this occurs when the template is undefined or because of capacity issues.

Tip: Set the Limit property to zero in order to disable the internal logic of the creator.

Arguments:
Optional: wait (bool): False by default. If True, the creator waits for capacity before trying to make a component.

Returns:
vcComponent: created component or None if it was not created.

Exceptions:
InvalidArgument: When this class is not owned by any node.
RuntimeError: When the object is owned by a node, but the owning node is not attached to any world.
RuntimeError: When the attached world does not have a valid simulation object.
RuntimeError: When it is called when simulation is not running.